//
//  HotBrandCollectionViewCell.m
//  19--Homework 汽车之家
//
//  Created by 冀永金 on 16/8/10.
//  Copyright © 2016年 冀永金. All rights reserved.
//

#import "HotBrandCollectionViewCell.h"
#import "HotBrandModel.h"
#import "UIImageView+WebCache.h"
@interface HotBrandCollectionViewCell ()
@property (nonatomic, strong) UIImageView *image;
@property (nonatomic, strong) UILabel *label;
@end
@implementation HotBrandCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self config];
    }
    return self;
}
- (void)config {
    self.image = [[UIImageView alloc]init];
    [self.contentView addSubview:self.image];
   // _image.backgroundColor = [UIColor yellowColor];
    self.label = [[UILabel alloc]init];
    [self.contentView addSubview:_label];
    self.label.textAlignment = 1;
    //_label.backgroundColor = [UIColor blueColor];
}
- (void)layoutSubviews {
    [super layoutSubviews];
    self.image.frame = CGRectMake(0, 0, self.contentView.bounds.size.width, self.contentView.bounds.size.width);
    self.label.frame = CGRectMake(0,  self.contentView.bounds.size.width + 10,  self.contentView.bounds.size.width, 40);
}
- (void)setHotModel:(HotBrandModel *)hotModel {
    _hotModel = hotModel;
    self.label.text = hotModel.name;
    NSURL *url = [NSURL URLWithString:hotModel.img];
    [self.image sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"concise_icon_favorite_normal"]];
}


@end
